﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Microsoft.Phone.Tasks;
using Conqueror.WP.ViewModel.Matchmaking;

namespace Conqueror.WP
{
    public partial class MatchmakingGamesPage : PhoneApplicationPage
    {
        public MatchmakingGamesPage()
        {
            InitializeComponent();
        }

        private void ShareCurrentGameButton(object sender, EventArgs e)
        {
            var task = new ShareLinkTask();
            task.LinkUri = new Uri("http://www.conquerclub.com/player.php?mode=join1&submit=Join&page=1&game=14756312", UriKind.Absolute);
            task.Title = "Here's a New Conquer Club Game";
            task.Show();
        }

        private void JoinGameButton(object sender, EventArgs e)
        {
            var task = new WebBrowserTask();
            task.Uri = new Uri("http://www.conquerclub.com/player.php?mode=join1&submit=Join&page=1&game=14756312", UriKind.Absolute);
            task.Show();
        }

        private void BrowseGamesButton(object sender, EventArgs e)
        {
            var task = new WebBrowserTask();
            task.Uri = new Uri("http://www.conquerclub.com/player.php?mode=join1", UriKind.Absolute);
            task.Show();
        }

        private Uri BuildJoinGameURI(string gameNumber)
        {
            return new Uri(string.Format("http://www.conquerclub.com/player.php?mode=join1&submit=Join&page=1&game={0}", gameNumber), UriKind.Absolute);
        }
    }
}